#include "macros.h"
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdlib.h>

int main(int argc, char * argv)
{
	printf("start clie...\n");
	int sofd = socket(PF_INET, SOCK_STREAM, 0);
	printf("sofd=%d\n", sofd);
	struct sockaddr_in myaddr;
	myaddr.sin_family = AF_INET;
	myaddr.sin_port = htons(LISTEN_PORT); 
	myaddr.sin_addr.s_addr = inet_addr("192.168.10.104");
	bzero(&(myaddr.sin_zero), 8);
	int ret = connect(sofd, (struct sockaddr *)&myaddr, sizeof(struct sockaddr));
	if(ret == -1)
	{
		printf("connect failed! exit!\n");
		return 0;
	}
	printf("connect ok!\n");
	while(1)
	{
		sleep(30);
		printf("sleep 30 sec!\n");
	}
}
